/*
 * @Author: your name
 * @Date: 2021-06-23 19:23:06
 * @LastEditTime: 2023-01-10 14:54:28
 * @LastEditors: pmy
 * @Description: In User Settings Edit
 * @FilePath: \bdcar-net\src\main.js
 */
// The Vue build version to load with the `import` command
// (runtime-only or standalone) has been set in webpack.base.conf with an alias.
import Vue from 'vue'
import App from './App'
import router from './router'
import store from './store'

import ElementUI from 'element-ui'
import 'element-ui/lib/theme-chalk/index.css'
Vue.use(ElementUI, {
  size: 'small'
})


import axios from 'axios'
Vue.prototype.$axios = axios

//设置兼容360,ie
import 'core-js/stable';
import 'regenerator-runtime/runtime';

// 兼容 Promise
import promise from 'es6-promise'
promise.polyfill()

Vue.config.productionTip = false // 以阻止 vue 在启动时生成生产提示

import "@/assets/instruct/dialogDrag"

Vue.mixin({
  methods: {
    /**
     * by pmy
     * 按钮鉴权方法
     * @export
     * @param {*} filesName 上级菜单名称名称
     * @param {*} pageName 页面名称
     * @param {*} btnName 按钮名称
     * @return
     */
    btnPermissionSearch(filesName, pageName, btnName) {
      try {
        let list = this.$store.state.availabelMenuList.find(v => {
          return v.index == filesName
        });
        let page = list.children.find(v => {
          return v.index === pageName
        })
        let _bool = !!page.children.find(v => {
          return v.index === btnName
        });
        return _bool;
      } catch (error) {
        return false
      }
    }
  }
})

import {
  setRemInit
} from '@/assets/js/rem';
setRemInit(); //进行初始化立即运行

new Vue({
  router,
  store,
  render: h => h(App)
}).$mount('#app')